<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link type="text/css" rel="stylesheet" href="{$data.url_prefix}resource/css/reset.css"/>
        <link type="text/css" rel="stylesheet" href="{$data.url_prefix}resource/css/api_index.css"/>
        <script type="text/javascript" src="{$data.url_prefix}resource/js/fw/jquery-1.8.3.min.js"></script>
    </head>
    <body>
        <div class="pk-wrap">

            <div class="pk-unit-wrap">
                <div class="pk-unit">
                    <h1 class="clearfix">
                        <span class="pk-color-title">{$data.title}</span>
                        <span class="pk-float-right pk-tip">{$data.title_tip}</span>
                    </h1>
                </div>
                <div class="pk-unit">
                    <div class="pk-unit-with-style">
                        <div class="pk-unit-tag">Description</div>
                        <pre>{$data.title_desc|escape:'html'}</pre>
                    </div>
                </div>
            </div>

            {if $data.arguments neq ''}
            <div class="pk-unit-wrap">
                <div class="pk-unit">
                    <h1 class="clearfix">
                        <span class="pk-color-title pk-italic">{$data.arguments}</span>
                    </h1>
                </div>
                <div class="pk-unit">
                    <table>
                        <thead>
                            <tr>
                                <th class="pk-w120">参数名</th>
                                <th>描述</th>
                            </tr>
                        </thead>
                        <tbody>
                            {foreach from=$data.arguments_name item=item key=key}
                            <tr>
                                <td>{$item}</td>
                                <td>{$data.arguments_desc[$key]}</td>
                            </tr>
                            {/foreach}
                        </tbody>
                    </table>
                </div>
            </div>
            {/if}

            {if $data.return neq ''}
            <div class="pk-unit-wrap">
                <div class="pk-unit">
                    <h1 class="clearfix">
                        <span class="pk-color-title pk-italic">{$data.return}</span>
                    </h1>
                </div>
                <div class="pk-unit">
                    <div class="pk-unit-with-style">
                        <div class="pk-unit-tag">Description</div>
                        <pre>{$data.return_desc}</pre>
                    </div>
                </div>
            </div>
            {/if}

            {if $data.attributes neq ''}
            <div class="pk-unit-wrap">
                <div class="pk-unit">
                    <h1 class="clearfix">
                        <span class="pk-color-title pk-italic">{$data.attributes}</span>
                    </h1>
                </div>
                <div class="pk-unit">
                    <table>
                        <thead>
                            <tr>
                                <th class="pk-w120">属性名</th>
                                <th>描述</th>
                            </tr>
                        </thead>
                        <tbody>
                            {foreach from=$data.attributes_name item=item key=key}
                            <tr>
                                <td>{$item}</td>
                                <td>{$data.attributes_desc[$key]}</td>
                            </tr>
                            {/foreach}
                        </tbody>
                    </table>
                </div>
            </div>
            {/if}

            {if $data.methods neq ''}
            <div class="pk-unit-wrap">
                <div class="pk-unit">
                    <h1 class="clearfix">
                        <span class="pk-color-title pk-italic">{$data.methods}</span>
                    </h1>
                </div>
                <div class="pk-unit">
                    <table>
                        <thead>
                            <tr>
                                <th class="pk-w120">方法名</th>
                                <th>描述</th>
                            </tr>
                        </thead>
                        <tbody>
                            {foreach from=$data.methods_name item=item key=key}
                            <tr>
                                <td>{$item}</td>
                                <td>{$data.methods_desc[$key]}</td>
                            </tr>
                            {/foreach}
                        </tbody>
                    </table>
                </div>
            </div>
            {/if}

            {if $data.code neq ''}
            <div class="pk-unit-wrap">
                <div class="pk-unit">
                    <h1 class="clearfix">
                        <span class="pk-color-title pk-italic">代码示例</span>
                    </h1>
                </div>
                <div class="pk-unit">
                    <div class="pk-unit-with-style pk-code">
                        <div class="pk-unit-tag">
                            <span>Code</span>
                        </div>
                        <div class="pk-unit-fns">
                            <a href="javascript:" title="Fold or unfold the code" data-rel="fold-btn">-Fold</a>
                            <a href="javascript:" data-rel="copy-code">Copy</a>
                        </div>
                        <pre>{$data.code}</pre>
                    </div>
                </div>
            </div>

            <script type="text/javascript" src="{$data.url_prefix}resource/js/fw/clipboard/ZeroClipboard.min.js"></script>
            <script type="text/javascript" src="{$data.url_prefix}resource/js/api_index.js"></script>
            <script type="text/javascript">
                if(window.clipboardData){
                    $('a[data-rel="copy-code"]').click(function(){
                        window.clipboardData.setData('text',$(this).parent().next().text());
                        alert("Copy successfully!");
                    });
                }else{
                    clipboard($('a[data-rel="copy-code"]'),"{$data.url_prefix}resource/js/fw/clipboard/ZeroClipboard.swf");
                }
            </script>
            {/if}
        </div>
    </body>
</html>
